<!DOCTYPE html>
<html lang="en">
<include file="CommonSidebar:common-head"/>
<link href="__ROOT__/Application/Home/Public/css/jquery.datetimepicker.css" rel="stylesheet">
<link href="__PUBLIC__/LoadPading/LoadPading.css" rel="stylesheet">
<style>
    #qrcode canvas {
        width: 100%;
        height: 100%;
    }
</style>
<body>

<div id="wrapper">

    <!-- Navigation -->
    <include file="CommonSidebar:common-navbar"/>

    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">批量导入商品图片</h1>
            </div>
        </div>
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-12">
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
                            <div class="panel panel-default">
                                <div class="panel-heading" role="tab" id="headingOne">
                                    <h4 class="panel-title">
                                        <a role="button" data-toggle="collapse" data-parent="#accordion"
                                           href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                                            批量导入商品
                                        </a>
                                    </h4>
                                </div>
                                <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel"
                                     aria-labelledby="headingOne">
                                    <div class="panel-body">
                                        <if condition="$DATA">
                                            <div class="form-group">
                                                <label class=" control-label " style="color: red">数据已上传内存，确认上传即可！！！重新导入内存请按重新导入即可</label>
                                            </div>
                                            <br/>
                                            <else/>
                                            <form role="form" action="{:U('import')}" method="post" id="Frm"
                                                  enctype='multipart/form-data'>
                                                <div class="form-group">
                                                    <input type="file" name="execel" class="form-control" required>
                                                </div>
                                                <div class="form-group">
                                                    <input type="submit" class="btn btn-success" value="导入内存"/>

                                                </div>
                                            </form>
                                        </if>
                                        <a href="{:U('clear')}"><input type="button"
                                                                       class="btn btn-success"
                                                                       value="重新导入/清除内存"/></a>
                                        <a href="{:U('importSQL')}"><input type="button"
                                                                           class="btn btn-success"
                                                                           value="确认批量导入"/></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        模板图片
                    </div>
                    <!-- /.panel-heading -->
                    <div class="panel-body">
                        <div class="dataTable_wrapper">
                            <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                <thead>
                                <tr>
                                    <th style="text-align:center">商品图片</th>
                                    <th style="text-align:center">图片位置</th>
                                    <th style="text-align:center">商品图片类型</th>
                                    <th style="text-align:center">商品链接</th>
                                    <th style="text-align:center">商品名称</th>
                                    <th style="text-align:center">商品价格</th>
                                    <th style="text-align:center">图片排序位置</th>
                                    <th style="text-align:center">导入状态</th>
                                </tr>
                                </thead>
                                <tbody>
                                <foreach name="DATA" item="v" key="k">
                                    <tr class="odd gradeX">
                                        <td><img width="100px" src="{$v['data']['PIC_PATH']}"/></td>
                                        <td>{$v['data']['PAGES']}</td>
                                        <td>{$v['data']['TYPES']}</td>
                                        <td>{$v['data']['URL']}</td>
                                        <td>{$v['data']['NAME']}</td>
                                        <td>{$v['data']['PRICE']}</td>
                                        <td>{$v['data']['SORT']}</td>
                                        <if condition="$v['STATE']==-1">
                                            <td>
                                                导入失败
                                                <span style="color: red">{$v['msg']}</span>
                                            </td>
                                        </if>
                                        <if condition="$v['STATE']==1">
                                            <td>未导入</td>
                                        </if>
                                        <if condition="$v['STATE'] ==0">
                                            <td>已导入成功</td>
                                        </if>
                                    </tr>
                                </foreach>
                                </tbody>
                            </table>
                        </div>
                        <!-- /.table-responsive -->
                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>
    </div>
    <!-- /#page-wrapper -->

</div>


<include file="CommonSidebar:common-script"/>
<!-- Custom Theme JavaScript -->
<script src="__ROOT__/Application/Home/Public/dist/js/sb-admin-2.js"></script>
<script type="text/javascript" src="__ROOT__/Application/Home/Public/js/uploadPreview.js"></script>
<script type="text/javascript" src="__ROOT__/Application/Home/Public/js/jquery.form.min.js"></script>
<script type="text/javascript" src="__ROOT__/Application/Home/Public/js/jquery.qrcode.min.js"></script>
<script src="__PUBLIC__/js/address.js"></script>
<script src="__PUBLIC__/LoadPading/LoadPading.js"></script>


</body>

</html>
